import { createBrowserRouter, Navigate } from 'react-router-dom'
import Login from '../pages/login/Index'
import Home from '../pages/home/Index'
import Index from '../pages/index/Index'
import Order from '../pages/order/Index'
import User from '../pages/user/Index'
import Uu from '../pages/user/uu/Index'
import Ss from '../pages/user/ss/Index'
import Error from '../pages/404/Index'

import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
    UserOutlined,
} from '@ant-design/icons';
export const homerouters = [
    {
        path: '/home/index',
        element: <Index />,
        title: '仪表盘',
        icon: <DesktopOutlined />
    },
    {
        path: '/home/order',
        element: <Order />,
        title: '数据可视化',
        icon: <FileOutlined />
    },
    {
        path: '/home/user',
        element: <User />,
        title: '列表页',
        icon: <PieChartOutlined />,
        children: [
            {
                path: '/home/user/uu',
                element: <Uu />,
                title: '查询表格',
                icon: <UserOutlined />
            },
            {
                path: '/home/user/ss',
                element: <Ss />,
                title: '卡片列表',
                icon: <TeamOutlined />
            }
        ]
    },
]
const router = createBrowserRouter([
    {
        path: '/',
        element: <Navigate to={'/home'}></Navigate>,

    },
    {
        path: '/home',
        element: <Home />,
        children: homerouters
    },
    {
        path: '/login',
        element: <Login />,

    },
    {
        path: '*',
        element: <Error />,

    }
])
export default router